package com.woniuxy.array02;

import java.util.Arrays;

/**
 * description: Test03 <br>
 * date: 2022/2/1 9:20 下午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */
public class Test03 {
    public static void main(String[] args) {
        int[] value = {3, 1, 6, 2, 9, 0, 7, 4, 5, 8};
        int temp = 0;
        for (int i = 0; i < value.length - 1; i++) {
            boolean flag = true;
            for (int j = 0; j < value.length - 1 - i; j++) {
                if (value[j] > value[j + 1]) {
                    temp = value[j];
                    value[j] = value[j + 1];
                    value[j + 1] = temp;
                    flag = false;
                }
                System.out.println(Arrays.toString(value));
            }
            if (flag) {
                System.out.println("结束！");
                break;
            }
            System.out.println("###");
        }
    }
}
